﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ThapCam.System;
using System.Data;
using ThapCam.Ulti;
using MySql.Data.MySqlClient;

namespace ThapCam.Provider
{
    public class DetailLogic : AbsPageLogic
    {
        public DetailLogic(ThapCamApplication application)
            : base(application)
        {

        }

        protected override void initData()
        {

        }

        public DataTable getListHot(int top)
        {
            SqlHelper helper = new SqlHelper();
            SqlParameter param_Limit = new SqlParameter("v_Limit", top, MySqlDbType.Int32);
            SqlParameter param_Offset = new SqlParameter("v_Offset", 0, MySqlDbType.Int32);
            DataTable table = helper.executeQuery("prc_TC_Subjects_GetListLimitNewest", CommandType.StoredProcedure, param_Limit, param_Offset);
            return table;
        }

        public Dictionary<string, object> getDetailSubject(int subjectID)
        {
            SqlHelper helper = new SqlHelper();
            SqlParameter param_ID = new SqlParameter("v_ID", subjectID, MySqlDbType.Int32);
            Dictionary<string, object> subject = helper.executeScalar("prc_TC_Subjects_GetSubjectDetail", CommandType.StoredProcedure, param_ID);
            return subject;
        }
    }
}